/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * RolePanel.java
 *
 * Created on 2011-8-21, 16:23:11
 */
package com.securitytrace.client;

import java.awt.event.ActionListener;

/**
 *
 * @author Administrator
 */
public class RolePanel extends javax.swing.JPanel {

	private static final long serialVersionUID = -4142566760016598348L;
	/** Creates new form RolePanel */
    public RolePanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        roleNameTextField = new javax.swing.JTextField();
        searchRoleButton = new javax.swing.JButton();
        addRoleButton = new javax.swing.JButton();
        updateRoleButton = new javax.swing.JButton();
        deleteRoleButton = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        roleInfoTable = new javax.swing.JTable();
        rolePreviousPageButton = new javax.swing.JButton();
        roleHomePageButton = new javax.swing.JButton();
        roleNnexPagetButton = new javax.swing.JButton();
        roleLastPageButton = new javax.swing.JButton();
        rolePageInfoLabel = new javax.swing.JLabel();
	
        jLabel1.setText("名称");
        searchRoleButton.setText("搜索");
        addRoleButton.setText("新增");
        updateRoleButton.setText("修改");
        deleteRoleButton.setText("删除");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(54, 54, 54)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(roleNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(searchRoleButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)
                .addComponent(addRoleButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(updateRoleButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(deleteRoleButton)
                .addGap(66, 66, 66))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {addRoleButton, deleteRoleButton, searchRoleButton, updateRoleButton});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(roleNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(searchRoleButton)
            .addComponent(addRoleButton)
            .addComponent(updateRoleButton)
            .addComponent(deleteRoleButton)
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {addRoleButton, deleteRoleButton, jLabel1, searchRoleButton, updateRoleButton});

        /*roleInfoTable.getColumnModel().getColumn(0).setMinWidth(130);
        roleInfoTable.getColumnModel().getColumn(0).setPreferredWidth(5);
        roleInfoTable.getColumnModel().getColumn(0).setMaxWidth(15);*/
        jScrollPane2.setViewportView(roleInfoTable);

        rolePreviousPageButton.setText("上一页");
        roleHomePageButton.setText("首  页");
        roleNnexPagetButton.setText("下一页");
        roleLastPageButton.setText("末页");

        javax.swing.GroupLayout rolePanelLayout = new javax.swing.GroupLayout(this);
        this.setLayout(rolePanelLayout);
        rolePanelLayout.setHorizontalGroup(
            rolePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, rolePanelLayout.createSequentialGroup()
                .addContainerGap(85, Short.MAX_VALUE)
                .addComponent(roleHomePageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rolePreviousPageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(roleNnexPagetButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(roleLastPageButton)
                .addGap(18, 18, 18)
                .addComponent(rolePageInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(69, 69, 69))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, rolePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(rolePanelLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 566, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(30, Short.MAX_VALUE))
        );
        rolePanelLayout.setVerticalGroup(
            rolePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(rolePanelLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 443, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(rolePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rolePreviousPageButton)
                    .addComponent(roleHomePageButton)
                    .addComponent(roleNnexPagetButton)
                    .addComponent(roleLastPageButton)
                    .addComponent(rolePageInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
	
    protected javax.swing.JButton addRoleButton;
    protected javax.swing.JButton deleteRoleButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane2;
    protected javax.swing.JButton roleHomePageButton;
    protected javax.swing.JTable roleInfoTable;
    protected javax.swing.JButton roleLastPageButton;
    protected javax.swing.JTextField roleNameTextField;
    protected javax.swing.JButton roleNnexPagetButton;
    protected javax.swing.JLabel rolePageInfoLabel;
    protected javax.swing.JButton rolePreviousPageButton;
    protected javax.swing.JButton searchRoleButton;
    protected javax.swing.JButton updateRoleButton;
    /***以下为get/set方法**/
	public javax.swing.JTable getRoleInfoTable() {
		return roleInfoTable;
	}
	public void setRoleInfoTable(javax.swing.JTable roleInfoTable) {
		this.roleInfoTable = roleInfoTable;
	}
	public javax.swing.JTextField getRoleNameTextField() {
		return roleNameTextField;
	}
	public void setRoleNameTextField(javax.swing.JTextField roleNameTextField) {
		this.roleNameTextField = roleNameTextField;
	}
	public javax.swing.JLabel getRolePageInfoLabel() {
		return rolePageInfoLabel;
	}
	public void setRolePageInfoLabel(javax.swing.JLabel rolePageInfoLabel) {
		this.rolePageInfoLabel = rolePageInfoLabel;
	}
	
	public void setAddRoleButton(ActionListener listener) {
		this.addRoleButton.addActionListener(listener);
	}
	public void setDeleteRoleButton(ActionListener listener) {
		this.deleteRoleButton.addActionListener(listener);
	}
	public void setRoleHomePageButton(ActionListener listener) {
		this.roleHomePageButton.addActionListener(listener);
	}
	public void setRoleLastPageButton(ActionListener listener) {
		this.roleLastPageButton.addActionListener(listener);
	}
	public void setRoleNnexPagetButton(ActionListener listener) {
		this.roleNnexPagetButton.addActionListener(listener);
	}
	public void setRolePreviousPageButton(ActionListener listener) {
		this.rolePreviousPageButton.addActionListener(listener);
	}
	public void setSearchRoleButton(ActionListener listener) {
		this.searchRoleButton.addActionListener(listener);
	}
	public void setUpdateRoleButton(ActionListener listener) {
		this.updateRoleButton.addActionListener(listener);
	}
}
